{% extends 'manage/manage_list.html' %}

{% block content %}

    <form action="{{ url_for('vipadmin.manage_edit', tid=manage_obj.tid) }}" method="post" enctype="multipart/form-data"
          class="form-horizontal">

        <h2 class="sub-header" style="text-align: center;">投放内容修改</h2>
        <p class="help-block" style="text-align: center;">多个微信号用 | 分割例如：aaa|bbb|ccc</p>
        {% if g.user.is_superuser %}

            <div class="form-group">
                <label for="web_url" class="col-sm-1 control-label col-md-offset-2">投放域名</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="web_url" name="web_url"
                           placeholder="请输入链接，例如：http://www.baidu.com/  必须要以http://开头和/结尾" value="{{ data.web_url.data }}">
                </div>
            </div>

            <div class="form-group">
                <label for="wechat" class="col-sm-1 control-label col-md-offset-2">投放微信</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="wechat" name="wechat"
                           placeholder="多个微信号用 | 分割例如：aaa|bbb|ccc" value="{{ data.wechat.data }}">
                </div>
            </div>

            <div class="form-group">
                <label for="throw_tid" class="col-sm-1 control-label col-md-offset-2">投放模板</label>
                <div class="col-sm-7">
                    {{ data.throw_tid }}
                </div>
            </div>

            <div class="form-group">
                <label for="cnzz" class="col-sm-1 control-label col-md-offset-2">cnzz号</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="cnzz" name="cnzz" placeholder="cnzz号"
                           value="{{ data.cnzz.data | default(0,true) }}">
                </div>
            </div>

            <div class="form-group">
                <label for="copyright_" class="col-sm-1 control-label col-md-offset-2">公司版权</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="copyright_" name="copyright_" placeholder="xxx有限公司"
                           value="{{ data.copyright_.data }}">
                </div>
            </div>

            <div class="form-group">
                <label for="base_js" class="col-sm-1 control-label col-md-offset-2">基础代码</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="base_js" name="base_js"
                              placeholder="媒体平台转换基础代码...">{{ data.base_js.data }}</textarea>
                </div>
            </div>

            <div class="form-group">
                <label for="transfer" class="col-sm-1 control-label col-md-offset-2">调用js</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="transfer" name="transfer" placeholder="媒体平台调用js..."
                           value="{{ data.transfer.data }}">
                </div>
            </div>

            <div class="form-group">
                <label for="third_api" class="col-sm-1 control-label col-md-offset-2">第三方api</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="third_api" name="third_api"
                              placeholder="第三方api">{{ data.third_api.data }}</textarea>
                </div>
            </div>

            <div class="form-group">
                <label for="remark" class="col-sm-1 control-label col-md-offset-2">备注</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="remark" name="remark"
                              placeholder="备注">{{ data.remark.data }}</textarea>
                </div>
            </div>
        {% else -%}
            <div class="form-group">
                <label for="web_url" class="col-sm-1 control-label col-md-offset-2">投放内容修改</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="web_url" name="web_url"
                           placeholder="请输入链接，例如：http://www.baidu.com" value="{{ data.web_url.data }}" disabled>
                </div>
            </div>

            <div class="form-group">
                <label for="wechat" class="col-sm-1 control-label col-md-offset-2">投放微信</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" id="wechat" name="wechat"
                           placeholder="多个微信号用 | 分割例如：aaa|bbb|ccc" value="{{ data.wechat.data }}">
                </div>
            </div>
            <div class="form-group">
                <label for="remark" class="col-sm-1 control-label col-md-offset-2">备注</label>
                <div class="col-sm-7">
                    <textarea class="form-control" id="remark" name="remark"
                              placeholder="备注">{{ data.remark.data }}</textarea>
                </div>
            </div>
        {% endif -%}<br>
        <div class="form-group">
            <div class="col-sm-offset-3 col-sm-7">
                <button type="submit" class="btn btn-primary btn-lg btn-block">提交</button>
            </div>
        </div>

        {{ data.csrf_token }}
    </form>
{% endblock -%}